<?php 
if(!$_SESSION['admin'] || !$index)
{
    include('404.php');
}
else
{
?>
<center>
<h2>Groep Aanpassen</h2>
<link rel="stylesheet" type="text/css" href="styles/inschrijvingen.css" />
<?php
$ps = new PreparedStatement("SELECT * FROM groepen WHERE groepid = ? LIMIT 1;");
$ps->setInt($_GET['groepid']);
$q = $ps->execute();
$row = mysql_fetch_array($q);

echo "<div style='padding: 10px; width: 600px; border: solid; border-width:1px;'>";
echo "<b>Algemeen</b>";
echo "<table>";
echo "<tr>";
echo "<td style='width: 120px;'>Groepnaam:</td>";
echo "<td>{$row['groepnaam']}</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='width: 120px;'>Startjaar:</td>";
echo "<td>{$row['startjaar']}</td>";
echo "</tr>";
echo "<tr>";
echo "<td style='width: 120px;'>Eindjaar:</td>";
echo "<td>{$row['eindjaar']}</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
echo "<br />";
echo "<div style='padding: 10px; width: 600px; border: solid; border-width:1px;'>";
echo "<b>Leiding</b>";
$ps = new PreparedStatement("SELECT *, CONCAT(voornaam, ' ', IFNULL(tussenvoegsels, ' '), ' ', achternaam) AS naam FROM leiding WHERE leidinggroepid = ? ORDER BY achternaam, voornaam ASC;");
$ps->setString($row['leidinggroepid']);
$q = $ps->execute();
echo "<table>";
echo "<tr><td style='width: 120px;' class='toprow'>Naam</td><td style='width: 130px;' class='toprow'>Adres</td><td style='width: 100px;' class='toprow'>Woonplaats</td><td style='width: 110px;' class='toprow'>Telefoon</td><td style='width: 100px;' class='toprow'>Mobiel</td></tr>";
while($row = mysql_fetch_array($q))
{
    echo "<tr><td>{$row['naam']}</td><td>{$row['adres']}</td><td>{$row['woonplaats']}</td><td>{$row['telefoon']}</td><td>{$row['mobiel']}</td></tr>";
}
echo "</table>";
echo "</div>";



echo "</center>";
}
?>